home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / chngcs11.hqx / ChangeCase XFCN 1.1 / cards.xml < prev    next >
Text File  |  1993-05-28  |  14KB  |  148 lines

  1. card_3020.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>3020</id>
  6.     <filler1>0</filler1>
  7.     <cantDelete> <false /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <owner>2808</owner>
  11.     <link rel="stylesheet" type="text/css" href="stylesheet_3307.css" />
  12.     <part>
  13.         <id>9</id>
  14.         <type>field</type>
  15.         <visible> <true /> </visible>
  16.         <dontWrap> <false /> </dontWrap>
  17.         <dontSearch> <false /> </dontSearch>
  18.         <sharedText> <false /> </sharedText>
  19.         <fixedLineHeight> <false /> </fixedLineHeight>
  20.         <autoTab> <false /> </autoTab>
  21.         <lockText> <false /> </lockText>
  22.         <rect>
  23.             <left>22</left>
  24.             <top>12</top>
  25.             <right>442</right>
  26.             <bottom>243</bottom>
  27.         </rect>
  28.         <style>transparent</style>
  29.         <autoSelect> <false /> </autoSelect>
  30.         <showLines> <false /> </showLines>
  31.         <wideMargins> <false /> </wideMargins>
  32.         <multipleLines> <false /> </multipleLines>
  33.         <reservedFamily> 0 </reservedFamily>
  34.         <titleWidth>0</titleWidth>
  35.         <icon>0</icon>
  36.         <textAlign>left</textAlign>
  37.         <font>Palatino</font>
  38.         <textSize>10</textSize>
  39.         <textStyle>plain</textStyle>
  40.         <textHeight>13</textHeight>
  41.         <name></name>
  42.         <script></script>
  43.     </part>
  44.     <part>
  45.         <id>3</id>
  46.         <type>field</type>
  47.         <visible> <true /> </visible>
  48.         <dontWrap> <false /> </dontWrap>
  49.         <dontSearch> <false /> </dontSearch>
  50.         <sharedText> <false /> </sharedText>
  51.         <fixedLineHeight> <false /> </fixedLineHeight>
  52.         <autoTab> <false /> </autoTab>
  53.         <lockText> <true /> </lockText>
  54.         <rect>
  55.             <left>9</left>
  56.             <top>7</top>
  57.             <right>471</right>
  58.             <bottom>250</bottom>
  59.         </rect>
  60.         <style>scrolling</style>
  61.         <autoSelect> <false /> </autoSelect>
  62.         <showLines> <false /> </showLines>
  63.         <wideMargins> <false /> </wideMargins>
  64.         <multipleLines> <false /> </multipleLines>
  65.         <reservedFamily> 0 </reservedFamily>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>0</icon>
  68.         <textAlign>left</textAlign>
  69.         <font>Geneva</font>
  70.         <textSize>10</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <textHeight>13</textHeight>
  73.         <name></name>
  74.         <script>on mouseUpput cd fld 1 into cd fld 2end mouseUp</script>
  75.     </part>
  76.     <part>
  77.         <id>13</id>
  78.         <type>button</type>
  79.         <visible> <true /> </visible>
  80.         <reserved5> 0 </reserved5>
  81.         <reserved4> 0 </reserved4>
  82.         <reserved3> 0 </reserved3>
  83.         <reserved2> 0 </reserved2>
  84.         <reserved1> 0 </reserved1>
  85.         <enabled> <true /> </enabled>
  86.         <rect>
  87.             <left>48</left>
  88.             <top>267</top>
  89.             <right>222</right>
  90.             <bottom>289</bottom>
  91.         </rect>
  92.         <style>roundrect</style>
  93.         <showName> <true /> </showName>
  94.         <highlight> <false /> </highlight>
  95.         <autoHighlight> <true /> </autoHighlight>
  96.         <sharedHighlight> <true /> </sharedHighlight>
  97.         <family>0</family>
  98.         <titleWidth>0</titleWidth>
  99.         <icon>0</icon>
  100.         <textAlign>center</textAlign>
  101.         <font>Chicago</font>
  102.         <textSize>12</textSize>
  103.         <textStyle>plain</textStyle>
  104.         <name>Try ChangeCase</name>
  105.         <script>on mouseUpglobal hyperDebugItput "True" into hyperDebugItask "Change case to: Uppercase, Lowercase, Title, Sentence, or Reverse" with "Upper"if it is empty then exit mouseUpput it into methodif method is "s" or method is "Sentence" thenask "Enter the characters that are valid sentence endings" with "!?.ΓǪ"put return & it into Endingsend ifput cd fld 2 into containerget ChangeCase("i") -- prewarm XFCNput the ticks into oldTimeput ChangeCase(container,method,endings) into theResultput number of chars in container && "chars," && the ticks - oldTime && "ticks(s)."if theResult is empty then exit mouseUpelse if number of lines in theResult = 1 then answer theResultelse put theResult into cd fld 2end mouseUp</script>
  106.     </part>
  107.     <part>
  108.         <id>15</id>
  109.         <type>button</type>
  110.         <visible> <true /> </visible>
  111.         <reserved5> 0 </reserved5>
  112.         <reserved4> 0 </reserved4>
  113.         <reserved3> 0 </reserved3>
  114.         <reserved2> 0 </reserved2>
  115.         <reserved1> 0 </reserved1>
  116.         <enabled> <true /> </enabled>
  117.         <rect>
  118.             <left>263</left>
  119.             <top>267</top>
  120.             <right>438</right>
  121.             <bottom>289</bottom>
  122.         </rect>
  123.         <style>roundrect</style>
  124.         <showName> <true /> </showName>
  125.         <highlight> <false /> </highlight>
  126.         <autoHighlight> <true /> </autoHighlight>
  127.         <sharedHighlight> <true /> </sharedHighlight>
  128.         <family>0</family>
  129.         <titleWidth>0</titleWidth>
  130.         <icon>0</icon>
  131.         <textAlign>center</textAlign>
  132.         <font>Chicago</font>
  133.         <textSize>12</textSize>
  134.         <textStyle>plain</textStyle>
  135.         <name>Reverse Case (hypertalk)</name>
  136.         <script>on mouseUpanswer "This pure HyperTalk example just reverses the case of all"┬¼&& "the characters in the XFCN description. Expect it to take"┬¼&& "over a minute!" with "Cancel" or "OK"if it is "Cancel" then exit mouseUpput cd fld 2 into containerput number of chars in container into CharCountset cursor to watchget HTReverseString("i") -- prewarm the functionput the ticks into oldTimeput HTReverseString(container) into theResultput CharCount && "Chars," && the ticks - oldTime && "ticks(s)."if theResult is empty then exit mouseUpelse put theResult into cd fld 2end mouseUpΓÇó HTReverseString function. ┬⌐ Ben Lawson, 1993. All rights reserved.ΓÇó Created by Ben Lawson, 93/01/31. This HyperTalk function isΓÇó equivilent to the ChangeCase XFCN's "reverse" form.ΓÇó It is included for comparision purposes only.function HTReverseString theStringput length(theString) into totalCharsrepeat with i = 1 to totalCharsput CharToNum(char i of theString) into charValueif charValue>96 and charValue<123 thenput NumToChar(charValue-32) into char i of theStringelse if charValue>64 and charValue<91 thenput NumToChar(charValue+32) into char i of theStringend ifend repeatreturn theStringend HTReverseString</script>
  137.     </part>
  138.     <content>
  139.         <layer>card</layer>
  140.         <id>9</id>
  141.         <text>ChangeCase XFCN 1.1. Copyright Ben Lawson, 1993. All rights reserved.Shareware payment $5.00 for individuals.Example (HyperTalk): answer ChangeCase("abc","upper") -- returns "ABC"Syntax: ChangeCase(Container,<Case>,<SentenceEndings>)    The ChangeCase XFCN takes text input and returns that text with the case of its characters changed according to the specified conversion method. This can be done in most scripting or macro languages (such as HyperTalk), but a compiled XFCN beats them for speed and simplicity of use. ChangeCase is ~ 1000 times faster than its HyperTalk equivilent on my Macintosh IIci.    ChangeCase is a 3 Kbyte resource that can be installed with ResEdit or a similar utility into any application that supports XCMDs and XFCNs. Example applications that can use XFCNs include HyperCard, Microphone Pro, and 4th Dimension.    Note: this XFCN is only designed to function properly with english ASCII input. Use with other character sets may give undesired results.Using ChangeCase============    ChangeCase can be used to quickly change the case of characters to the following states:        Lowercase: all letters in lowercase.        Reverse: capitals change into lowercase, lowercase letters change into capitals.        Sentence: first letter of each sentence capitalized, other letters in lowercase.        Title: first letter of each word capitalized, other letters in lowercase.        Uppercase: all letters capitalized.    ChangeCase does _not_ affect the following characters:        ΓÇó  "High" characters (those with ASCII values higher than 126) such as "├Ñ", "┬⌐",             and "Γùè".        ΓÇó  "Low" characters (those with ASCII values lower than 33), such as returns, tabs              and linefeeds, as well as other esoteric characters that normally appear as little             boxes if they are visible at all.        ΓÇó  Numbers or normal symbols and punctuation such as "7", "?", "$" and "@".Syntax:  ChangeCase(Container,<Case>,<SentenceEndings>)========================================ΓÇó Container    The text you want to process. If the container contains only "?" or "!" ChangeCase will return brief help or version information respectively.ΓÇó <Case> (optional: default is "uppercase")    How you want to change the case of the characters. If not present or empty ChangeCase will assume you want to convert the text to normal "sentence" form. Choices are "lowercase" (or "lower" or  "l"), "sentence" (or "s"), "title" (or "t"), "reverse" (or "r"), or "uppercase" (or "upper" or "u"). As you may have gathered, only the first letter of the chosen form is required.    The "sentence" form may give undesirable results, depending on where significant punctuation characters appear. Proper nouns within a sentence will also be adversely affected. All other form will give predictable results.ΓÇó <SentenceEndings> (optional: default is any of "?", "!", "." or "ΓǪ")    This parameter is only used by the "sentence" form. It specifies a string of characters that can signify the end of a sentence. If not present or empty, ChangeCase  assumes you wish to start a new sentence after a return, "?", "!", "." or "ΓǪ" character that is followed by white space (blank or tab characters). This option may give unanticipated results depending on where the characters you are treating as sentence endings appear within the text.Error Messages===========    If an empty container is sent to ChangeCase, ChangeCase will simply return an empty string (however, be aware that if you mistype the name of the  variable that is holding your text HyperCard will assume the the mistyped variable is actually the string itself, and thus ChangeCase will receive and process a short string).    There are only two error messages that can occur.ΓÇó  "Error: conversion form specified in param 2 not recognized." will be returned if the second parameter doesn't match the allowed values.ΓÇó  "Error: result does not match input." will be returned if characters have been lost or added to the original string.Examples of Use===========on mouseUp    put "abc 123. DEF" into theText    answer ChangeCase(theText, "reverse")         -- gives "ABC 123. def"    answer ChangeCase(theText, "title")               -- gives "Abc 123. Def"    answer ChangeCase(theText, "upper")            -- gives "ABC 123. DEF"    answer ChangeCase(theText, "lower")             -- gives "abc 123. def"    answer ChangeCase(theText, "sentence")        -- gives "Abc 123. Def"end mouseUpStandard Legal Stuff==============    The ChangeCase XFCN is Copyright 1993 Ben Lawson. All rights reserved.    The ChangeCase XFCN is provided "as-is" and without warranty of any kind. The author expressly disclaims all implied warranties, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the results and performance of this software is assumed by you. All trademarks mentioned herein are the property of their respective owners.    In addition to paying the shareware fee, the following copyright notice must be present in any application or HyperCard stack that uses the ChangeCase XFCN: ΓÇ£The ChangeCase XFCN used herein is copyright 1993 by Ben Lawson with all rights reserved.ΓÇ¥ This notice need not be visible to users of the application or HyperCard stack.Registration=========    The ChangeCase XFCN in this stack is shareware. This means that you are welcome to use it for a trial period of two weeks without cost. However, if you wish to continue to use this XFCN you must pay the appropriate shareware fee. For personal or non-commercial use, you must pay the author a $5.00 (US or Canadian) shareware fee. Payment of the shareware fee entitles registrants to use future versions without further charge.    Users wishing to incorporate the ChangeCase XFCN into a commercial product or include it in a for-sale collection must obtain a commercial use license from the author. For use in a single product, the shareware fee is $25 (US or Canadian). For use in an unlimited number of products, the shareware fee is $50 (US or Canadian). Certain restrictions on the use of the ChangeCase XFCN may also apply.    Individuals and non-profit oganizations such as registered Apple User Groups may freely distribute the ChangeCase XFCN only if it is distributed in this HyperCard stack without modifications or is contained within an application or HyperCard stack created by a registered user of the ChangeCase XFCN.Contact Information==============    Please send all comments, bug reports, or licensing inquiries to:Internet: ben_lawson@cmac.eastern.com (preferred)               ben_lawson@magic-bbs.corp.apple.comAmerica Online: LAWSON2    Please send all shareware payments (money orders preferred) to:        Ben Lawson        60 Clifton Road        Toronto, Ontario, M4T 2E9        CANADAVersion History===========ΓÇó 1.1: Released 93/05/09.   Finally got around to optimizing the sentence conversion method. A five-fold speed improvement now means that it's only three times slower than the simpler methods.    Also changed the default <case> form to "uppercase".ΓÇó 1.0.3: Released 93/05/02.    Improved "sentence" <case> form to recognize numbers and high characters as valid sentence beginnings.ΓÇó┬á1.0.2: Released  93/02/17.   Slightly modified legal values for the <case> parameter. "lower" and "upper" are now recognized.ΓÇó┬á1.0.1: Released 93/02/09.    Added error check to report if the text string has lost or gained characters during processing.ΓÇó┬á1.0: Released 93/01/31.    First fully functional version. For my personal use only.End</text>
  142.     </content>
  143.     <name></name>
  144.     <script></script>
  145. </card>
  146.  
  147.  
  148.